<template>
	<view class="formula-pages">
		<CustomNav :isBack="true" :topBgColor="topBgColor" title="反映问题"></CustomNav>
		<image src="@/static/image/home/bg.png" class="bg-img"></image>
		<view class="info-block" :style="'margin-top:'+mt">
			<template v-if="list.length>0">
				<view class="info-item" v-for="item in list" :key="item.id">
					<view class="title">{{item.name}}</view>
					<view class="info-list" v-for="item1 in item.child" :key="item1.id"
						@click="navigate('/pages/reflect/index?id='+item1.id+'&name='+item1.name)">
						<view class="name">{{item1.name}}</view>
					</view>
				</view>
			</template>
			<view v-else class="empty">暂无数据</view>
		</view>
	</view>
</template>

<script>
	import {
		getPerTree
	} from '@/api/reflect.js'
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			getList() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				getPerTree().then(res => {
					this.list = res
				})
			},
		},
		onLoad(e) {
			this.getList()
		}
	}
</script>

<style lang="scss" scoped>
	.formula-pages {
		overflow: hidden;
		min-height: 100vh;
		background-color: #F8FBFF;

		.bg-img {
			width: 100%;
			height: 100%;
			position: absolute;
		}

		.info-block {
			position: relative;
			padding: 30rpx;
			margin: 0 auto;
			width: calc(100% - 60rpx);
			background-color: #fff;
			border-radius: 30rpx;

			.info-item:last-child {
				border-bottom: none;
			}

			.info-item {
				border-bottom: 1px solid #f6f6f6;

				.title {
					line-height: 100rpx;
					color: #3153b5;
					border-bottom: 1px solid #f6f6f6;
					font-size: 32rpx
				}

				.info-list:last-child {
					border-bottom: none;
				}

				.info-list {
					line-height: 100rpx;
					border-bottom: 1px solid #f6f6f6;
					font-size: 30rpx;
					padding-left: 30rpx;

					.name {
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
				}
			}
		}
	}
</style>